package com.parktech.sun.domain.repository.specialtopic.hibernate;

import com.parktech.sun.domain.model.specialtopic.SpecialTopic;
import com.parktech.sun.domain.model.specialtopic.SpecialTopicCategory;
import com.parktech.sun.domain.repository.hibernate.BaseRepositoryImpl;
import com.parktech.sun.domain.repository.specialtopic.SpecialTopicRepository;
import org.springframework.stereotype.Repository;

/**
 * User: Think
 * Date: 11-1-12
 * Time: 下午7:54
 */
@Repository("specialTopicRepository")
public class SpecialTopicRepositoryImpl extends BaseRepositoryImpl<SpecialTopic> implements SpecialTopicRepository {

    public SpecialTopicCategory getCategoryById(Long specialTopicCategoryId) {
        return (SpecialTopicCategory) getSession().get(SpecialTopicCategory.class, specialTopicCategoryId);
    }

    public void saveOrUpdateCategory(SpecialTopicCategory specialTopicCategory) {
        getSession().saveOrUpdate(specialTopicCategory);
    }
}
